<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MNNKit: MNNHandGestureDetection/iOS/MNNHandGestureDetection/MNNHandGestureDetection/MNNHandGestureDetector.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="mnn.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MNNKit
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">MNNKit is a collection of AI solutions on mobile phone, powered by MNN engine.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_c7e855008d665c037ec22392504f50da.html">MNNHandGestureDetection</a></li><li class="navelem"><a class="el" href="dir_2e043e6937ae22196292341472bf12a2.html">iOS</a></li><li class="navelem"><a class="el" href="dir_69366e82965ae46060acc4437989f3fa.html">MNNHandGestureDetection</a></li><li class="navelem"><a class="el" href="dir_322a70c84119dc49e54f565a3400f4c9.html">MNNHandGestureDetection</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">MNNHandGestureDetector.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_m_n_n_hand_gesture_detector_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//  MNNHandGestureDetector.h</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//  MNNHandGestureDetection</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//  Created by MNN 2019/12/25.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//  Copyright © 2019, Alibaba Group Holding Limited</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#import &lt;UIKit/UIKit.h&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#import &lt;MNNKitCore/CoreCommon.h&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#import &lt;MNNKitCore/MNNMonitor.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="_m_n_n_hand_gesture_detector_8h.html#a57567af2cbd9dd6cc412f27cba05e8fc">   14</a></span>&#160;<span class="keyword">static</span> NSString *<a class="code" href="_m_n_n_hand_gesture_detector_8h.html#a57567af2cbd9dd6cc412f27cba05e8fc">MNNKitErrorDomain</a> = <span class="stringliteral">@&quot;MNNKitErrorDomain&quot;</span>;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="_m_n_n_hand_gesture_detector_8h.html#aac837fcd0e477a2fe38f5eb80eb3d9e8">   17</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="_m_n_n_hand_gesture_detector_8h.html#aac837fcd0e477a2fe38f5eb80eb3d9e8">NS_ENUM</a>(NSUInteger, MNNHandDetectMode) {</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    MNN_HAND_DETECT_MODE_VIDEO = 0,</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    MNN_HAND_DETECT_MODE_IMAGE = 1,</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;};</div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="interface_m_n_n_hand_gesture_detector_create_config.html">   22</a></span>&#160;<span class="keyword">@interface </span><a class="code" href="interface_m_n_n_hand_gesture_detector_create_config.html">MNNHandGestureDetectorCreateConfig</a> : NSObject</div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="interface_m_n_n_hand_gesture_detector_create_config.html#a7f1b08597e8f066893b6cba7b6cbacf2">   24</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) MNNHandDetectMode <a class="code" href="interface_m_n_n_hand_gesture_detector_create_config.html#a7f1b08597e8f066893b6cba7b6cbacf2">detectMode</a>;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">@end</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="_m_n_n_hand_gesture_detector_8h.html#ac4c3bfa9cbc3c95b78a2e21881031be8">   28</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="_m_n_n_hand_gesture_detector_8h.html#aac837fcd0e477a2fe38f5eb80eb3d9e8">NS_ENUM</a>(NSUInteger, MNNHandGestureType) {</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    MNN_HAND_GESTURE_TYPE_FINGER_HEART = 0, </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    MNN_HAND_GESTURE_TYPE_HAND_OPEN = 1,    </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    MNN_HAND_GESTURE_TYPE_INDEX_FINGER = 2, </div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    MNN_HAND_GESTURE_TYPE_FIST = 3,         </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    MNN_HAND_GESTURE_TYPE_THUMB_UP = 4,     </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    MNN_HAND_GESTURE_TYPE_OTHER = 5,        </div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;};</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="interface_m_n_n_hand_gesture_detection_report.html">   39</a></span>&#160;<span class="keyword">@interface </span><a class="code" href="interface_m_n_n_hand_gesture_detection_report.html">MNNHandGestureDetectionReport</a> : NSObject</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="interface_m_n_n_hand_gesture_detection_report.html#a0d5be42cd580e2cc3aa170355dde0db1">   42</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) MNNHandGestureType type;</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="interface_m_n_n_hand_gesture_detection_report.html#a8356e3a300ac8999a40fb3cb39a3d11c">   44</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) <span class="keywordtype">float</span> score;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">// hand unique identification, new handID will be generated if hand track is lossed but detected successfully again</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="interface_m_n_n_hand_gesture_detection_report.html#ad38f138530f2c1694b3a5297761886c9">   46</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) <span class="keywordtype">int</span> handID;</div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="interface_m_n_n_hand_gesture_detection_report.html#ade9d78c56fe3d9f351d3e8c2c6d7c11f">   48</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) CGRect rect;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">@end</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="interface_m_n_n_hand_gesture_detector.html">   54</a></span>&#160;<span class="keyword">@interface </span><a class="code" href="interface_m_n_n_hand_gesture_detector.html">MNNHandGestureDetector</a> : NSObject</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;+ (void)createInstanceAsync:(<a class="code" href="interface_m_n_n_hand_gesture_detector_create_config.html">MNNHandGestureDetectorCreateConfig</a>*)config callback:(<span class="keywordtype">void</span>(^)(NSError *error, <a class="code" href="interface_m_n_n_hand_gesture_detector.html">MNNHandGestureDetector</a> *handgestureDetector))block;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;+ (void)createInstanceAsync:(<a class="code" href="interface_m_n_n_hand_gesture_detector_create_config.html">MNNHandGestureDetectorCreateConfig</a>*)config callback:(<span class="keywordtype">void</span>(^)(NSError *error, <a class="code" href="interface_m_n_n_hand_gesture_detector.html">MNNHandGestureDetector</a> *handgestureDetector))block callbackQueue:(dispatch_queue_t)callbackQueue;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="comment">// output angle, the coordinate of raw output feature points will rotate outAngle degree in in the image coordinate system. Generally in order to reach the same direction with the rendering coordinate system, then feature points will be easily rendered.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;- (NSArray&lt;<a class="code" href="interface_m_n_n_hand_gesture_detection_report.html">MNNHandGestureDetectionReport</a> *&gt; *)inference:(CVPixelBufferRef)pixelBuffer</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                                         angle:(<span class="keywordtype">float</span>)inAngle outAngle:(<span class="keywordtype">float</span>)outAngle flipType:(MNNFlipType)flipType</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                                         error:(NSError *__autoreleasing *)error;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;- (NSArray&lt;<a class="code" href="interface_m_n_n_hand_gesture_detection_report.html">MNNHandGestureDetectionReport</a> *&gt; *)inferenceImage:(UIImage*)image</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                                              angle:(<span class="keywordtype">float</span>)inAngle outAngle:(<span class="keywordtype">float</span>)outAngle flipType:(MNNFlipType)flipType</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                                              error:(NSError *__autoreleasing *)error;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;- (NSArray&lt;<a class="code" href="interface_m_n_n_hand_gesture_detection_report.html">MNNHandGestureDetectionReport</a> *&gt; *)inference:(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)data width:(<span class="keywordtype">float</span>)w height:(<span class="keywordtype">float</span>)h format:(MNNCVImageFormat)format</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                                         angle:(<span class="keywordtype">float</span>)inAngle outAngle:(<span class="keywordtype">float</span>)outAngle flipType:(MNNFlipType)flipType</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                                         error:(NSError *__autoreleasing *)error;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="keyword">@end</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="a_m_n_n_hand_gesture_detector_8h_html_a57567af2cbd9dd6cc412f27cba05e8fc"><div class="ttname"><a href="_m_n_n_hand_gesture_detector_8h.html#a57567af2cbd9dd6cc412f27cba05e8fc">MNNKitErrorDomain</a></div><div class="ttdeci">static NSString * MNNKitErrorDomain</div><div class="ttdef"><b>Definition:</b> MNNHandGestureDetector.h:14</div></div>
<div class="ttc" id="a_m_n_n_hand_gesture_detector_8h_html_aac837fcd0e477a2fe38f5eb80eb3d9e8"><div class="ttname"><a href="_m_n_n_hand_gesture_detector_8h.html#aac837fcd0e477a2fe38f5eb80eb3d9e8">NS_ENUM</a></div><div class="ttdeci">typedef NS_ENUM(NSUInteger, MNNHandDetectMode)</div><div class="ttdoc">hand gesture detect mode</div><div class="ttdef"><b>Definition:</b> MNNHandGestureDetector.h:17</div></div>
<div class="ttc" id="ainterface_m_n_n_hand_gesture_detector_create_config_html_a7f1b08597e8f066893b6cba7b6cbacf2"><div class="ttname"><a href="interface_m_n_n_hand_gesture_detector_create_config.html#a7f1b08597e8f066893b6cba7b6cbacf2">MNNHandGestureDetectorCreateConfig::detectMode</a></div><div class="ttdeci">MNNHandDetectMode detectMode</div><div class="ttdoc">detect mode, video or image</div><div class="ttdef"><b>Definition:</b> MNNHandGestureDetector.h:24</div></div>
<div class="ttc" id="ainterface_m_n_n_hand_gesture_detector_html"><div class="ttname"><a href="interface_m_n_n_hand_gesture_detector.html">MNNHandGestureDetector</a></div><div class="ttdoc">Hand Gesture Detector Class.</div><div class="ttdef"><b>Definition:</b> MNNHandGestureDetector.h:54</div></div>
<div class="ttc" id="ainterface_m_n_n_hand_gesture_detection_report_html"><div class="ttname"><a href="interface_m_n_n_hand_gesture_detection_report.html">MNNHandGestureDetectionReport</a></div><div class="ttdoc">hand gesture detection result</div><div class="ttdef"><b>Definition:</b> MNNHandGestureDetector.h:39</div></div>
<div class="ttc" id="ainterface_m_n_n_hand_gesture_detector_create_config_html"><div class="ttname"><a href="interface_m_n_n_hand_gesture_detector_create_config.html">MNNHandGestureDetectorCreateConfig</a></div><div class="ttdoc">hand gesture detector create config</div><div class="ttdef"><b>Definition:</b> MNNHandGestureDetector.h:22</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
